{layout name="p/base"}
    <div class="row">
      <div class="col-lg-12">
        <h1>营地管理 <small>营地信息列表</small></h1>
        <ol class="breadcrumb">
          <li><a href="index.php"><i class="fa fa-dashboard"></i> 管理首页</a></li>
          <li><a href="/camp"><i class="fa fa-dashboard"></i> 营地信息列表</a></li>
          <li class="active"><i class="fa fa-table"></i> 营地信息草稿箱</li>
        </ol>
        <div class="alert alert-success alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          这里可以添加、修改、删除营地信息
        </div>
      </div>
    </div>
    <!-- /.row -->
    <div class="row">
      <div class="col-lg-12">
        <form class="form-horizontal" role="form" action="/camp/dra" method="get">
        <div class="form-group input-group" style="width:40%;float:right;">
          <input class="form-control" type="text" name="keyword">
          <span class="input-group-btn">
            <button type="submit" class="btn btn-default">搜索</button>
          </span>
        </div>
        <div class="form-group" style="float:right;margin-right:10px;">
          <select class="form-control" name="searchfield">
          <option value="number">按营地编号</option>
          <option value="name">按营地名称</option>
          <option value="address">按地址</option>
          <option value="tel">按电话</option>
          </select>
        </div>
        </form>




        <div class="btn-group">
          <a href="/camp/create" class="btn btn-primary">添加营地</a>
        </div>
        <div class="btn-group">
         <button type="button" id='del' class="btn btn-default">删除</button>
        </div>
        <div class="btn-group">
          <button type="button" id='publish' class="btn btn-default">发布</button>
        </div>
        <a href="/camp">已发布</a>
        <a href="/camp/del" class="btn btn-link">回收站</a>
        <div class="table-responsive">
          <table class="table table-bordered table-hover table-striped tablesorter">
            <thead>
              <tr>
                <th><div class="checker"><span><input type="checkbox" name=""></span></div></th>
                <th>营地编号</th>
                <th>营地名称</th>
                <th>营地类型</th>
                <th>营地星级</th>
                <th>泊位数量</th>
                <th>地址</i></th>
                <th>电话</i></th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
            <form id='camp' class="form-horizontal" role="form" action="/camp/delete" method="post">
            <input type="hidden" id='method' name="_method" value="DELETE">
            <input type="hidden" name="status" value="1" />
             {foreach $camps as $v}
              <tr>
                <td><div class="checker"><span><input type="checkbox" name="ids[]" value="{$v.id}"></span></div></td>
                <td>{$v.number}</td>
                <td><a href="###">{$v.name}</a></td>
                <td>{$v->getType($v.type)}</td>
                <td>{$v->getGrade($v.grade)}</td>
                <td>{$v.count}</td>
                <td>{$v.address}</td>
                <td>{$v.tel}</td>
                <td><a href="/camp/{$v.id}/edit">编辑</a> | <a href="/camp/{$v.id}/park">泊位信息</a></td>
              </tr>
            {/foreach}
            </form>
            </tbody>
          </table>
        </div>
      </div>
      {$camps->render()}
    </div>
    <!-- /.row -->
    
  </div><!-- /#page-wrapper -->
 <script type="text/javascript" src="/jquery.js"></script>
    <script type="text/javascript">
      $(document).ready(function(){
        $("#del").click(function(){
          $("#camp").submit();
          });
        $("#publish").click(function(){
        $("#camp").attr('action','/camp/setstatus');
        $("#camp").submit();
          });
        });
      
  </script>

